﻿@using HGShare.Site
@using HGShare.VWModel
@{
    UserVModel currentUser = ViewData["CurrentPartUserInfo"] == null ? null : (UserVModel)ViewData["CurrentPartUserInfo"];
    bool userIsLogin = ViewData["IsLogin"] != null && Convert.ToBoolean(ViewData["IsLogin"]);
    string flyStyle = HGShare.Common.CookieHelper.GetValue("fly-style");
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>@ViewBag.Title - @ViewData["WebName"]</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="@ViewBag.Keywords">
    <meta name="description" content="@ViewBag.Description">
    <link rel="shortcut icon" type="image/x-icon" href="@Url.StaticFile("/res/images/favicon.ico")">
    <link rel="stylesheet" href="@Url.StaticFile("/res/layui/css/layui.css")">
    @*<link rel="stylesheet" href="@Url.StaticFile("/res/css/global.css")">*@
    <link rel="stylesheet" href="@Url.StaticFile("/res/css/global.css")">
    <link href="@Url.StaticFile("/res/plugins/prism/prism.css")" rel="stylesheet" />
    <link rel="stylesheet" data-href="@Url.StaticFile("/res/css/full.css")" class="fly-style" @Html.Raw(flyStyle == "stretch" ? "href=\"" + Url.StaticFile("/res/css/full.css") + "\"" : "") >
    @RenderSection("script_header", false)
</head>
<body class="@ViewBag.BodyClass" >
    <div class="header">
        <div class="main">
            <a class="logo" href="/" title="Fly">Fly社区</a>
            @Html.Action("HeaderNav", "Home", new { current = ViewData["HeadNavCurrent"] })
            <div class="nav-user">
                @if (!userIsLogin)
                {
                    <!-- 未登入状态 -->
                    <a class="unlogin" href="@Url.Action("Login", "Vip")"><i class="iconfont icon-touxiang"></i></a>
                    <span><a href="@Url.Action("Login", "Vip")">登入</a><a href="@Url.Action("Reg", "Vip")">注册</a></span>
                    <p class="out-login">
                        @*<a href="" onclick=" layer.msg('正在通过QQ登入', { icon: 16, shade: 0.1, time: 0 }) " class="iconfont icon-qq" title="QQ登入"></a>
                        <a href="" onclick=" layer.msg('正在通过微博登入', { icon: 16, shade: 0.1, time: 0 }) " class="iconfont icon-weibo" title="微博登入"></a>*@
                    </p>
                }
                else
                {
                    <!-- 登入后的状态 -->
                    <a class="avatar" href="@Url.Action("UserCenter", "User")">
                        <img src="@Tools.GenerateAvatar(currentUser.Avatar,60,currentUser.Sex)">
                        <cite>@currentUser.NickName</cite>
                        <i>@currentUser.RName</i>
                    </a>
                    <div class="nav">
                        <a href="@Url.Action("UserSet", "User")"><i class="iconfont icon-shezhi"></i>设置</a>
                        <a href="@Url.Action("LogOut","Vip")"><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>退了</a>
                    </div>
                }
            </div>
        </div>
    </div>
    @RenderBody()
    @Html.Partial("_Footer")
    <script src="@Url.StaticFile("/res/layui/layui.js")"></script>
    <script src="@Url.StaticFile("/res/plugins/prism/prism.js")"></script>
    @RenderSection("script_footer", false)
    <script type="text/javascript">
    layui.cache.islogin =@(userIsLogin?"true":"false");
    //加载公共设施
    layui.config({
        version: "@HGShare.Site.Config.WebSysConfig.SysVersion",
        base: '/res/mods/'
    }).use(['main', 'config'], function() {
        //验证码配置
        layui.config.verifycodeOption = {
            apiurl: '@Url.Action("verifycode", "api")',
            logingimg: '@Url.StaticFile("/res/images/loading.gif")'
        };
        layui.jquery(function() {
            layui.jquery.get('@Url.Action("visitlog", "api", new {url = Request.Url, reReferer = Request.UrlReferrer})', {}, function() {});
        });
    });
    </script>
    @RenderSection("main_back_Script", false)
    @*@if (userIsLogin)
        {
        <script type="text/javascript">
            layui.use('loggedin', function () {
                layui.loggedin.timingRefreshUserInfo("@Url.Action("refreshuserinfo", "vip")");
            });
        </script>
        }*@
</body>
</html>